package com.woniu.rear.config;

import java.util.Arrays;
import java.util.List;

import org.springframework.stereotype.Component;

import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

/**
   *   配置网关整体swagger入口
 * @author liwei
 *
 */
@Component
public class ResourceProvider implements SwaggerResourcesProvider {

	@Override
	public List<SwaggerResource> get() {
		return Arrays.asList(
				createSwaggerResource("报修模块数据维护","/maintenance-data/v2/api-docs","2.0"),
				createSwaggerResource("报修模块业务流程","/maintenance-business/v2/api-docs","2.0")
		);
	}
	
	private SwaggerResource createSwaggerResource(String name,String url,String version) {
		SwaggerResource sr = new SwaggerResource();
		sr.setName(name);
		sr.setLocation(url);
		sr.setSwaggerVersion(version);
		return sr;
	}

}
